<template>
	<div class="components-container">

    <div>
        <ul class="toolList">
            <li v-if="btnShow(item.BTNVALUE)" v-for="(item, index) in $store.state.btnListCommon" @click="operate(item.BTNVALUE)">
                <el-button type="primary" :value="item.BTNSHOWNAME" v-text="item.BTNSHOWNAME"></el-button>
            </li>
        </ul>
    </div>
    <!--数据列表-->
    <dataTable :headList="headList" :dataList="list" :pageOrder="pageOrder" @pageChange="pageChange" @selectRow="selectRow"></dataTable>
   <sweet-main ref="fingerMain" @refreshData="getData"></sweet-main>
  
	</div>

</template>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/common.scss";
  
</style>
<script>

import apiBase from "@/api/apiBase.js";
import dataTable from "@/components/Table/DataTable";
import { manage } from "@/mixins/managePage.js";
import sweetMain from './fingerPrintMain'
import { ORDER } from "@/const/orderConst.js";


const ADD = "新增";
const MODIFY = "修改";
const DELETE = "删除";
const INFO = "详情";

export default {
  name: "userManage",
  mixins: [manage],
  data() {
    return {
      list: [],
      selectData: {},
    };
  },
  methods: {

      //功能操作
    operate(order) {
      this.order = order;
      switch (this.order) {
        case ADD:        
           this.$refs.fingerMain.open(this.order);
          break;
          case DELETE:
            this.$refs.fingerMain.open(this.order, this.currentRow.USKID);
          break;
        default:
      }
    },

     //获取列项
    getColumns() {

      let data = {};
      apiBase.DoService(data, apiBase.getApiAdress().Column.GetFingerPrintColumns, res => {
        this.headList = res.data.content;
      });
    },

    getData() {

      let Data = JSON.parse(JSON.stringify(this.selectData));
      var data = {
        PageIndex: this.pageOrder.currentPage,
        PageSize: this.pageOrder.pageSize,
        OrderBy: this.pageOrder.orderType,
        OrderByType: this.pageOrder.orderSort,
        Data: Data
      };
      apiBase.DoService(data, apiBase.getApiAdress().Fingerprint.Query, res => {
        this.list = res.data.content.OutData;
        this.pageOrder.totalNum = res.data.content.RecordCount;
      });
     
    },
  },
  mounted() {
   
  },
  components: {
   
    dataTable,
    sweetMain
  
  },
  created() {
    this.getColumns()
    this.getData()
  }
};
</script>